<template>
	<view class="user-section">
		<image class="bg" src="/static/user-bg1.png"></image>
		<view class="user-info-box">
			<view class="portrait-box">
				<image class="portrait" :src="userInfo.portrait || '/static/missing-face.png'"></image>
			</view>
			<view class="info-box">
				<text class="username">{{userInfo.nickname || '游客'}}</text>
			</view>
		</view>
		<view class="vip-card-box">
			<image class="card-bg" src="/static/vip-card-bg.png" mode=""></image>
			<view class="b-btn" @touchstart="handleOpen">
				立即开通
			</view>
			<view class="tit">
				<text class="yticon icon-iLinkapp-"></text>
				DCloud会员
			</view>
			<text class="e-m">DCloud Union</text>
			<text class="e-b">开通会员开发无bug 一测就上线</text>
		</view>
	</view>
</template>

<script>
	export default {
		name: "uni-user-order",
		props: {
			userInfo: {
				// type: Function,
				required: true
			}
		},
		methods: {
			handleOpen() {
				console.log('TODO: 追被开通')
			}
		}
	}
</script>

<style lang="scss" scoped>
	.user-section {
		height: 520upx;
		padding: 100upx 30upx 0;
		position: relative;

		.bg {
			position: absolute;
			left: 0;
			top: 0;
			width: 100%;
			height: 100%;
			filter: blur(1px);
			opacity: 0.7;
		}
	}

	.user-info-box {
		height: 180upx;
		display: flex;
		align-items: center;
		position: relative;
		z-index: 1;

		.portrait {
			width: 130upx;
			height: 130upx;
			border: 5upx solid #fff;
			border-radius: 50%;
		}

		.username {
			font-size: $font-lg + 6upx;
			color: $font-color-dark;
			margin-left: 20upx;
		}
	}

	.vip-card-box {
		display: flex;
		flex-direction: column;
		color: #f7d680;
		height: 240upx;
		background: linear-gradient(to left, rgba(0, 0, 0, .7), rgba(0, 0, 0, .8));
		border-radius: 16upx 16upx 0 0;
		overflow: hidden;
		position: relative;
		padding: 20upx 24upx;

		.card-bg {
			position: absolute;
			top: 20upx;
			right: 0;
			width: 380upx;
			height: 260upx;
		}

		.b-btn {
			position: absolute;
			right: 20upx;
			top: 16upx;
			width: 132upx;
			height: 40upx;
			text-align: center;
			line-height: 40upx;
			font-size: 22upx;
			color: #36343c;
			border-radius: 20px;
			background: linear-gradient(to left, #f9e6af, #ffd465);
			z-index: 1;
		}

		.tit {
			font-size: $font-base+2upx;
			color: #f7d680;
			margin-bottom: 28upx;

			.yticon {
				color: #f6e5a3;
				margin-right: 16upx;
			}
		}

		.e-b {
			font-size: $font-sm;
			color: #d8cba9;
			margin-top: 10upx;
		}
	}
</style>
